# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)

MY_LOCAL_PATH :=  $(call my-dir)
ELA_LOCAL_PATH := $(MY_LOCAL_PATH)/ela/src
RUDP_LOCAL_PATH := $(MY_LOCAL_PATH)/rudp/src
FOILS_LOCAL_PATH := $(MY_LOCAL_PATH)/foils/src

################# ELA #####################################
#Change local path to ela directory to build ela
LOCAL_PATH := $(ELA_LOCAL_PATH)
include $(CLEAR_VARS)
# Shared version of the library is named 'bar_shared'
LOCAL_MODULE := ela
LOCAL_SRC_FILES := ela.c
LOCAL_C_INCLUDES := $(ELA_LOCAL_PATH)/../..
include $(BUILD_STATIC_LIBRARY)

################# RUDP #####################################
#Change local path to rudp directory to build rudp
LOCAL_PATH := $(RUDP_LOCAL_PATH)
include $(CLEAR_VARS)
# Shared version of the library is named 'bar_shared'
LOCAL_STATIC_LIBRARIES := ela
LOCAL_MODULE := rudp
LOCAL_SRC_FILES := address.c server.c rudp_list.h peer.c endpoint.c client.c packet.c rudp.c rudp_rudp.h rudp_error.h rudp_packet.h
LOCAL_C_INCLUDES := $(RUDP_LOCAL_PATH)/../..
include $(BUILD_STATIC_LIBRARY)

################# FOILS #####################################
#Change local path to FOILS directory to build FOILS
LOCAL_PATH := $(FOILS_LOCAL_PATH)
include $(CLEAR_VARS)
# Shared version of the library is named 'bar_shared'
LOCAL_STATIC_LIBRARIES := rudp
LOCAL_MODULE := foils
LOCAL_SRC_FILES := foils_hid.c rudp_hid_client.c
LOCAL_C_INCLUDES := $(FOILS_LOCAL_PATH)/../..
include $(BUILD_STATIC_LIBRARY)



LOCAL_PATH := $(MY_LOCAL_PATH)

include $(CLEAR_VARS)
LOCAL_STATIC_LIBRARIES := rudp foils ela
LOCAL_MODULE    := remoteUDP
LOCAL_SRC_FILES := remote.c term_input.c term_input.h mapping.c mapping.h

include $(BUILD_SHARED_LIBRARY)
